import org.apache.commons.io.FileUtils;
import org.jsoup.Connection;
import org.jsoup.Jsoup;

import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;

public class Test {
    @org.junit.Test
    public void mytest() throws IOException {
        FileUtils.write(new File("D:\\dvp\\workspace\\1.txt"), "ss");
    }

    @org.junit.Test
    public void FileUtilTest() {
        try {
            Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1080));

            Connection.Response response = Jsoup.connect("https://www.baidu.com").proxy(proxy).timeout(10000).ignoreContentType(true).execute();
//            response.bodyAsBytes().length<response.header("Content-Length");
            System.out.println(response.header("Content-Length"));

            System.out.println(response.bodyAsBytes().length);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
